package pub.tbc.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import pub.tbc.toolkit.collection.MapBuilder;

import java.util.Map;

/**
 * @author tbc on 2016/10/9 15:08:06.
 */
@RestController
public class DemoController {


    @GetMapping("/demo1")
    public Map<String, Object> demo() {
        return new MapBuilder<String, Object>().put("key-demo1", "value-demo1").build();
    }

    @GetMapping("/demo2")
    public Map<String, Object> demo2() {
        return new MapBuilder<String, Object>().put("key-d2", "value-d2").build();
    }

    @PostMapping("/demo3")
    public Map<String, String> demo3(@RequestBody Map<String, String> param) {
        System.out.println(param);
        return param;
    }
}
